const mongoose = require('mongoose')

const schema = new mongoose.Schema({
  nid: {
    type: String
  },
  coursename: {
    type: String
    //课程名字
  },
  teacher: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: 'Teacher'
    //教师
  },
  coursenature: {
    type: String
    //课程性质
  },
  specialty: {
    type: mongoose.SchemaTypes.ObjectId,
    ref: 'Specialty', //所属专业
  },
  time: {
    type: String
  }, //上课时间
  year: {
    type: String
    //学年
  },
  xq: {
    type: String
    //第几学期
  },
  address: {
    type: String
  }, //上课地点,
  week: {
    type: String
    //上几周
  },
  zxf: {
    type: Number
  }, //总学分
  zjd: {
    type: Number
  }, //总绩点
  class: {
    type: mongoose.SchemaTypes.ObjectId,
      ref: 'Class'
    //班级
  }
})

module.exports = mongoose.model('Course', schema)